// const { hot } = require('uni-pages-hot-modules')
module.exports = (pagesJson) => {

	const appPages = [{
		"path": "pages/login/login_psd", //密码登陆
		"style": {}
	}, {
		"path": "pages/index/index", //首页
		"style": {}
	}, {
		"path": "pages/other/set", //个人设置
		"style": {}
	}, {
		"path": "pages/other/notice", //平台公告
		"style": {}
	}, {
		"path": "pages/other/external_page", //网页链接
		"style": {}
	}, {
		"path": "pages/other/address", //地址管理
		"style": {}
	}, {
		"path": "pages/other/address_info", //地址管理-新增编辑
		"style": {}
	}, {
		"path": "pages/other/document", //文档详情
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}, {
		"path": "pages/login/find_psd", //找回/修改密码
		"style": {}
	}, {
		"path": "pages/login/find_pay_psd", //修改-支付密码
		"style": {}
	}, {
		"path": "pages/login/register", //注册
		"style": {}
	}, {
		"path": "pages/demo/index", //demo
		"style": {}
	}];

	const pcPages = [{
		"path": "pages/login/register", //注册
		"style": {}
	}, {
		"path": "pages/other/document", //文档
		"style": {}
	}, {
		"path": "pages/other/ad_info", //广告图片
		"style": {}
	}];

	let nowpages = [];
	if (process.env.VUE_APP_PLATFORM == 'h5') {
		console.log(process.env.NODE_ENV);
		if (process.env.NODE_ENV == 'development') {
			nowpages = appPages.concat(pcPages);
		} else {
			nowpages = pcPages;
		}
	} else if (process.env.VUE_APP_PLATFORM == 'app-plus') {
		nowpages = appPages;
	}
	nowpages.forEach(li => {
		li.style['app-plus'] = {
			"bounce": "none", //关闭窗口回弹效果
		}
	})

	return {
		// 合并pages.json的内容  
		pages: nowpages,
		"globalStyle": {
			"titleNView": false,
			"navigationBarTitleText": "龙神之铭",
			"navigationBarTextStyle": "white"
		},
		"tabBar": {
			"color": "#C8C8C8",
			"selectedColor": "#333333",
			"borderStyle": "white",
			"backgroundColor": "#ffffff",
			"list": [{
				"pagePath": "pages/index/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "首页"
			}, {
				"pagePath": "pages/demo/index",
				"iconPath": "static/tabbar/img_1.png",
				"selectedIconPath": "static/tabbar/img_1.png",
				"text": "demo"
			},
				// {
				// 	"pagePath": "pages/ecology/index",
				// 	"iconPath": "static/tabbar/img_2.png",
				// 	"selectedIconPath": "static/tabbar/img_2.png",
				// 	"text": "生态"
				// },
				// {
				// 	"pagePath": "pages/mine/index",
				// 	"iconPath": "static/tabbar/img_3.png",
				// 	"selectedIconPath": "static/tabbar/img_3.png",
				// 	"text": "我的"
				// }
			]
		},
		"easycom": {
			"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "uni_modules/z-paging/components/z-paging$1/z-paging$1.vue"
		}
	}
}